﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Net;
using System.Net.Sockets;

namespace TeamWork_Client
{
    public class ChatClient
    {
        TcpClient tcp;
        StreamWriter writer;
        public StreamReader reader;

        public ChatClient(string address, string nickname)
        {
            tcp = new TcpClient((address == "127.0.0.1" ? "localhost" : address), 22021);
            Stream sr = tcp.GetStream();
            writer = new StreamWriter(sr);
            reader = new StreamReader(sr);

            writer.WriteLine(nickname);
            writer.Flush();
        }

        public void SendMessage(string msg)
        {
            writer.WriteLine(msg);
            writer.Flush();
        }

        public void SendPM(string msg, string user)
        {

        }
    }
}
